<template>
  <div>
    <!-- 头部 -->
    <van-nav-bar title="基本信息" class="titleStyle" fixed left-arrow @click-left="onClickLeft" />
    <div class="contentBox">
      <div class="informationBox">
        <ul>
          <li>
            <div class="informationLeft fl">登录账号:</div>
            <div class="informationRight fl">{{ users.account }}</div>
          </li>
          <li>
            <div class="informationLeft fl">姓名</div>
            <div class="informationRight fl">{{ users.name }}</div>
          </li>
          <li>
            <div class="informationLeft fl">性别:</div>
            <div class="informationRight fl">{{ users.sex === 1 ? '男' : '女' }}</div>
          </li>
          <li>
            <div class="informationLeft fl">工号:</div>
            <div class="informationRight fl">{{ users.jobNum }}</div>
          </li>
          <li>
            <div class="informationLeft fl">手机号:</div>
            <div class="informationRight fl">{{ users.mobile }}</div>
          </li>
          <li>
            <div class="informationLeft fl">邮箱:</div>
            <div class="informationRight fl">{{ users.mail }}</div>
          </li>
          <li>
            <div class="informationLeft fl">入职时间:</div>
            <div class="informationRight fl">{{ users.entryTime }}</div>
          </li>
          <li>
            <div class="informationLeft fl">所属部门:</div>
            <div class="informationRight fl">
              <van-field v-model="users.deptName" rows="2" autosize type="textarea" disabled />
            </div>
          </li>
          <li>
            <div class="informationLeft fl">岗位:</div>
            <div class="informationRight fl">
              <van-field v-model="users.postName" rows="2" autosize type="textarea" disabled />
            </div>
          </li>
          <li>
            <div class="informationLeft fl">角色:</div>
            <div class="informationRight fl">
              <van-field v-model="users.roleName" rows="2" autosize type="textarea" disabled />
            </div>
          </li>
          <li>
            <div class="informationLeft fl">常驻地址:</div>
            <div class="informationRight fl">
              <van-field v-model="users.permanentAddress" rows="2" autosize type="textarea" disabled />
            </div>
          </li>
          <li>
            <div class="informationLeft fl">家庭地址:</div>
            <div class="informationRight fl">
              <van-field v-model="users.homeAddress" rows="2" autosize type="textarea" disabled />
            </div>
          </li>
        </ul>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      users: {},
      roleNameAll: null
    }
  },
  mounted () {
    this.getUser()
  },
  methods: {
    async getUser () {
      const res = await this.$axios.get(`/dobo-user/user/info?id=${JSON.parse(localStorage.getItem('padUserInfo')).data.userId}`)
      this.users = res.data.data
    },
    onClickLeft () {
      this.$router.push('/My')
    }
  }
}
</script>

<style scoped lang='scss'>
.contentBox {
  .informationBox {
    padding: 2%;
    ul{
      padding: 5px;
      li{
        padding: 5px 0;
        overflow: hidden;
        .informationLeft {
          background: #fff;
          text-align: center;
          border: 1px solid #ddd;
          height: 35px;
          line-height: 35px;
          width: 130px;
          margin-right: 10px;
        }
        .informationRight {
          width: calc(100% - 144px);
          background: #fff;
          border: 1px solid #ddd;
          min-height: 35px;
          line-height: 35px;
          padding-left: 10px;
        }
      }
    }
    .van-cell {
      border: none !important;
    }
  }
}
</style>
